Charlie is a shy teenager without friends who has just joined the high school. He misses his best friend, who had committed suicide. He writes letters to an imaginary friend telling his feelings. As a freshman in High School, Charlie, portrayed by Logan Lerman, struggles with bullies, depression, bad influences, and girls. Soon Charlie befriends the veteran Patrick, who is gay, and his stepsister Sam and they become best friends.
Charlie wants to be a writer and he also becomes the favorite student of his teacher of literature, Mr. Anderson, who lends him books. Finally being happy, Charlie experiments with drugs, sex, and the party scene. But underlying problems from the past cause Charlie to spiral out of control.
Sam and Patrick introduce Charlie to their friends and Charlie falls in love with Sam, but he does not have the self-confidence to date her. Even with this accepting group, Charlie admits he still doesn’t know how to act around people. A misstep that could threaten those friendships.
Charlie discovers a new world and feels happy with his friends, and he dates their common friend Mary Elizabeth. But when they end their relationship. Patrick asks Charlie to stay away from them for a while and soon he triggers his mental illness again. He goes to the hospital where a doctor finally discloses the origin of his problem. He may not be able to escape fully his past. Specific issues about who he considered the person he loved most in the world before meeting Sam, namely his now-deceased Aunt Helen.
He wakes up in the hospital. His physician, Dr. Burton explains to Charlie’s parents that his Aunt Helen was sexually abusing him and that Charlie repressed the memory because he blamed himself for her death. After Charlie is discharged from the hospital a few weeks later, Sam and Patrick visit him and take him to their favorite restaurant.
They once again drive into the tunnel. Sam tells Charlie that she finally found the song that was playing the last time they were there. Charlie climbs into the back of the truck and reminisces about life as whole. He kisses Sam, stands up and screams as they exit the tunnel.